(WIP) feat: upstream graphql codegen and query-builder#552
Closed
(WIP) feat: upstream graphql codegen and query-builder#552
Conversation
pyramation
reviewed
Jan 4, 2026
| #!/usr/bin/env node | ||
|
|
||
| // This is the CLI entry point that loads the built CLI module | ||
| import('../dist/cli/index.js').catch((err) => { |
Contributor
Author
There was a problem hiding this comment.
oh, while it looks weird at first, this is actually a common convention to use for binary executable, we are just creating a shim executable to point to that file. Example in the wild:
https://github.com/vitejs/vite/blob/main/packages/vite/bin/vite.js#L62
- Remove bin/graphql-codegen.js wrapper script that imported from ../dist/cli/index.js - Point bin directly to ./dist/cli/index.js (tsup already adds shebang via banner config) - Remove 'bin' from files array since bin folder is deleted This aligns with the pattern used by pgpm and cnc CLIs which don't have runtime code reaching into dist/ folder.
- Add publishConfig.directory = 'dist' so npm publishes from dist/ folder - Update bin to 'cli/index.js' (relative to published root, no dist/ prefix) - Update main/module/types to be relative to dist/ (no ./dist/ prefix) - Update all exports paths to be relative to dist/ - Remove files field (not needed with publishConfig.directory) This matches the exact pattern used by pgpm and cnc CLIs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR upstreams changes from dashboard/admin package to extract and update graphql codegen and query-builder packages. The
@constructive-io/graphql-codegenpackage has been completely replaced with the new CLI-based GraphQL SDK generator.Key Changes
makagetotsupgraphql-codegenwith commands:init,generate,generate-orm@tanstack/react-query,reactgql-astworkspace packageUpdates Since Last Revision
publishConfig.directorypublishConfig.directory: "dist"so npm publishes from dist/ as package root./dist/cli/index.jstocli/index.js(relative to published dist/ root)./dist/prefix)filesfield (not needed with publishConfig.directory)Review & Testing Checklist for Human
This is a BREAKING CHANGE with significant risk. Please verify:
pnpm packin graphql/codegen to confirm the tarball structure is correct.packages/gql-asthas a properpackage.jsonand builds correctlynode dist/cli/index.js --helpand actual commands (init,generate,generate-orm)pnpm -C graphql/codegen buildand verifydist/cli/index.jshas shebang and is executable@tanstack/react-queryandreactpeer deps don't cause issues for existing consumersRecommended Test Plan
pnpm install && pnpm -C graphql/codegen buildnode graphql/codegen/dist/cli/index.js --helpcd graphql/codegen && pnpm pack- check tarball has correct structure with cli/index.js at rootNotes
Link to Devin run: https://app.devin.ai/sessions/6edd77d00d4a4bf9a7716555906394ec
Requested by: Dan Lynch (@pyramation)
Note
BREAKING: package replaced with new CLI-based GraphQL SDK
graphql-codegenwith commandsinit,generate,generate-orm; extensive newREADME.md,docs/DEVELOPMENT.md, and runnable examples underexamples/gql-ast; adds peer deps@tanstack/react-query,reactdistviapublishConfig.directory; adds bin entry and wrapperbin/graphql-codegen.jssrc/__tests__/codegen/*).gitignorefor build artifacts and generated outputsWritten by Cursor Bugbot for commit b57dda5. This will update automatically on new commits. Configure here.